package rhc.discribute.node.connecter.impl.zookper.watchCallback;

import java.util.concurrent.CountDownLatch;

import org.apache.zookeeper.WatchedEvent;

import rhc.discribute.BaseComponent;
import rhc.discribute.node.connecter.impl.zookper.WatchCallback;
import rhc.discribute.node.exception.CallbackException;

/**执行latch countDown动作回调
 * @author rhc
 *
 */
public class LatchWatchCallback extends BaseComponent implements WatchCallback {

	@Override
	public void executeCallback(WatchedEvent event, Object callbackData) throws CallbackException {
		String path=event.getPath();
		CountDownLatch latch=(CountDownLatch) callbackData;
		
		latch.countDown();
	}

	@Override
	public boolean isSync() {
		return false;
	}
	
}
